﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using OgilvyOne.BLL;
using OgilvyOne.Model;
using System.Collections;
using ECCIT;
using ECCIT.Web;
using OgilvyOne.UKNow.Model;
using OgilvyOne.UKNow.BLL;
using OgilvyOne.UKNow.Globalization;
using System.IO;

public partial class admin_UKNOW_Default : AdminBasePage
{
    private const string VIEWSTATE_COLUMN_ID = "columnid";
    private const string VIEWSTATE_LAYER_ID = "layerid";
    int sid = 2052;
    string sname = "";
    int tid = 2052;
    string tname = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState[VIEWSTATE_COLUMN_ID] = int.Parse(Request.Params[VIEWSTATE_COLUMN_ID]);
            ViewState[VIEWSTATE_LAYER_ID] = Request.Params[VIEWSTATE_LAYER_ID];                     
        }      
    }
    protected void SourceEventLangID_SelectedIndexChanged(object sender, EventArgs e)
    {
        sid = Convert.ToInt32( SourceEventLangID.SelectedValue);
        List<EventsModel> Eventlist = new EventsBLL(sid).seleventsByName(sid);
        this.SourceEventName.Items.Clear();
        foreach (EventsModel events in Eventlist)
        {
           this.SourceEventName.Items.Add(new ListItem( events.Title, events.ID.ToString()));   
        }
    }
    protected void SourceEventName_SelectedIndexChanged(object sender, EventArgs e)
    {
        sname = SourceEventName.SelectedValue;
        IList<EventsModel> Eventlist = new EventsBLL(sid).selEveByNandL(sid,sname);
        this.SourceEventID.Items.Clear();
        foreach (EventsModel events in Eventlist)
        {
            this.SourceEventID.Items.Add(new ListItem(events.ID.ToString(), events.ID.ToString()));
        }
    }
    protected void ToEventLangID_SelectedIndexChanged(object sender, EventArgs e)
    {
        tid = Convert.ToInt32(ToEventLangID.SelectedValue);
        List<EventsModel> Eventlist = new EventsBLL(tid).seleventsByName(tid);
        this.ToEventName.Items.Clear();
        foreach (EventsModel events in Eventlist)
        {
            this.ToEventName.Items.Add(new ListItem(events.Title, events.ID.ToString()));
        }
    }
    protected void ToEventName_SelectedIndexChanged(object sender, EventArgs e)
    {
        tname = ToEventName.SelectedValue;
        IList<EventsModel> Eventlist = new EventsBLL(tid).selEveByNandL(tid, tname);
        this.ToEventID.Items.Clear();
        foreach (EventsModel events in Eventlist)
        {
            this.ToEventID.Items.Add(new ListItem(events.ID.ToString(), events.ID.ToString()));
        }
    }
    protected void Sub_click(object sender, EventArgs e)
    {

    }
}